part of '../animation.dart';

class LxShadowVFX extends StatelessWidget {
  final Widget child;
  final double opacity;
  final double blur;
  final Color color;
  const LxShadowVFX({
    this.blur = 2,
    this.opacity = 1,
    required this.color,
    required this.child,
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    assert(blur >= 0);
    return Stack(
      children: <Widget>[
        if (blur != 0)
          ImageFiltered(
            imageFilter: ui.ImageFilter.blur(
              sigmaY: blur,
              sigmaX: blur,
              tileMode: TileMode.decal,
            ),
            child: Opacity(
              opacity: opacity,
              child: ColorFiltered(
                colorFilter: ColorFilter.mode(color, BlendMode.srcATop),
                child: child,
              ),
            ),
          ),
        child,
      ],
    );
  }
}
